/* @flow */
'use strict';

var React = require('react-native');

var {
	StyleSheet,
	View,
	SwitchIOS
} = React;

var SwitchIOSView = React.createClass({

	getInitialState: function() {
		return {
			eventSwitchIsOn: false,
		};
	},

	changeValue: function(value) {

		console.log(value);
		this.setState({
			eventSwitchIsOn: value
		});
	},

	render: function() {
		return (
			<View style={styles.content}>
				
				<SwitchIOS
		          disabled={true}
		          style={{marginBottom: 10}}
		          value={true} />
		         <SwitchIOS
		            onValueChange={this.changeValue}
		            style={{marginBottom: 10}}
		            value={this.state.eventSwitchIsOn} />
			</View>
		);
	}
});


var styles = StyleSheet.create({
	content: {
		flex: 1,
		marginTop: 64,
		alignItems: 'center'
	}
});


module.exports = SwitchIOSView;